﻿@using Tonus.Models
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ContactFormModel>

@{
    Html.EnableClientValidation(true);
    Html.EnableUnobtrusiveJavaScript(true);
}

@if (!Convert.ToBoolean(TempData["IsSuccessful"]))
{
    using (Html.BeginUmbracoForm<ContactFormController>("SendEmail", new { recieverEmail = Umbraco.Field("contactemail") }))
    {
        @Html.ValidationSummary(true)
        @Html.AntiForgeryToken()

        <h4>Изпратете съобщение</h4>
        <br />
    
        @Html.TextBoxFor(model => model.Name, new { placeholder = "Вашето име" })
        @Html.ValidationMessageFor(model => model.Name)
        <br />

        @Html.TextAreaFor(model => model.Message, new { placeholder = "Съобщение" })
        @Html.ValidationMessageFor(model => model.Message)
        <br />
    
        <a class="btnSendMessage" href="javascript:;" onclick="parentNode.submit();">
            <span>Изпрати</span>
        </a>
    }
}

<p>@TempData["EmailMessage"]</p>
